package gui;

import javax.swing.JFrame;

public class StartGUI extends JFrame{
	/**
	 * This creates a GameMap object and an Inventory Object and then adds it to the JFrane
	 */
	private static final long serialVersionUID = 1L;
	public StartGUI(int inWindowWidth, int inWindowHeight){
		setResizable(false);
		
		int windowWidth=0, windowHeight = 0;
		
		for(windowWidth = inWindowWidth;windowWidth%32!=0; windowWidth++);
		for(windowHeight = inWindowHeight;windowHeight%32!=0; windowHeight++);
		System.out.println(windowHeight);
		setSize(windowWidth,windowHeight+28);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setLocationRelativeTo(null);
		System.out.println("WindowWidth ="+windowWidth);
		System.out.println("WindowHeight ="+windowHeight);
		GameMap gameMap = new GameMap(windowHeight, windowHeight);
		gameMap.setBounds(0, 0, windowHeight, windowHeight);
		add(gameMap);
		
		Inventory inventory = new Inventory(windowWidth-windowHeight, windowHeight);
		inventory.setBounds(windowWidth, 0, windowWidth-windowHeight, windowHeight);
		add(inventory);
		
		Player player = new Player();
		gameMap.addPlayer(player);
	}
}
